<template>
	<view>
		<view v-if="!islog" class="pr2 pl2 pb2" style="border-bottom: 1px solid #efefef;" v-for="(item,index) in list" :key="index">
			<view class="typee" style="margin: 0 0 20rpx 20rpx;">{{item.successTimeStr}}</view>
			<view class="flexs">
				<!-- <view class="typee">{{item.stateStr}}</view> -->
				<view class="typee">{{item.mark}}</view>
				<view class="fl">
					<view class="">{{item.tradeTypeStr}}</view>
					<!-- <view class="">{{item.mark}}</view> -->
					<view class="">{{item.totalShow}}花瓣</view>
				</view>
			</view>
		</view>
		<view v-if="!islog&&list.length==0" class="flex j-c a-c" style="background-color: #fff;">
			<!-- <text class="f24 c_pl1">暂无数据</text> -->
			<image src="../../static/tab/null.png" style="width:400rpx;height:400rpx;margin-top: 40rpx;" mode="aspectFill"></image>
		</view>
	</view>
</template>

<script>
	export default {
		props: {
			options: {
				type: Object,
				default: function(e) {
					return {}
				}
			},
			list: {
				type: Array,
				default: function() {
					return [] //数据
				},
			},
			islog: {
				type: Boolean, //是否显示边框
				default: true
			},
			log: {
				type: String,
				default: ''
			},
			qiniu: {
				type: String,
				default: ''
			},
			tabindex: {
				type: Number,
				default: 0
			},
			index: {
				type: Number,
				default: 0
			},
			time: {
				type: Number,
				default: 0
			},
			type: {
				type: Number,
				default: 0
			},
		},

		filters: {
			timeStamp1: function(timestamp) {
				function zeroize(num) {
					return (String(num).length == 1 ? '0' : '') + num;
				}
				var curTimestamp = parseInt(new Date().getTime() / 1000); //当前时间戳
				var timestampDiff = curTimestamp - timestamp; // 参数时间戳与当前时间戳相差秒数

				var curDate = new Date(curTimestamp * 1000); // 当前时间日期对象
				var tmDate = new Date(timestamp * 1000); // 参数时间戳转换成的日期对象

				var Y = tmDate.getFullYear(),
					m = tmDate.getMonth() + 1,
					d = tmDate.getDate();
				var H = tmDate.getHours(),
					i = tmDate.getMinutes(),
					s = tmDate.getSeconds();

				if (timestampDiff < 60) { // 一分钟以内
					return "刚刚";
				} else if (timestampDiff < 3600) { // 一小时前之内
					return Math.floor(timestampDiff / 60) + "分钟前";
				} else if (curDate.getFullYear() == Y && curDate.getMonth() + 1 == m && curDate.getDate() == d) {
					return '今天' + zeroize(H) + ':' + zeroize(i);
				} else {
					var newDate = new Date((curTimestamp - 86400) * 1000); // 参数中的时间戳加一天转换成的日期对象
					if (newDate.getFullYear() == Y && newDate.getMonth() + 1 == m && newDate.getDate() == d) {
						return '昨天' + zeroize(H) + ':' + zeroize(i);
					} else if (curDate.getFullYear() == Y) {
						return zeroize(m) + '月' + zeroize(d) + '日 ' + zeroize(H) + ':' + zeroize(i);
					} else {
						return Y + '年' + zeroize(m) + '月' + zeroize(d) + '日 ' + zeroize(H) + ':' + zeroize(i);
					}
				}
			}

		},
		data() {
			return {}
		},
		mounted() {

		},
		methods: {}
	}
</script>

<style lang="less">
	.flexs {
		display: flex;
		justify-content: space-between;
		margin: 0 20rpx;

		.typee {
			font-weight: bold;
			font-size: 30rpx;
		}

		.fl {
			display: flex;
			justify-content: space-between;
		}
	}

	page {
		background-color: #fff;
	}

	.boxstyle {
		border-bottom: 2rpx solid #e6e6e6;
		padding-bottom: 20rpx;
	}

	.but_audit {
		display: inline-block;
		padding: 10rpx 20rpx;
		border-radius: 10rpx;
		color: #fff;
	}

	.ff {
		padding: 8rpx 14rpx;
		color: #fff;
		border-radius: 20rpx;
		font-size: 25rpx;
	}

	.mc {
		position: absolute;
		background-color: #4e4e4ec7;
		color: #fff;
		text-align: center;
		z-index: 999;
		line-height: 160rpx;
		width: 160rpx;
		height: 160rpx;
	}
</style>